﻿#region Imports

using System;
using System.Collections.Generic;
using MammothMicro.SilverSocket.Protocol.System;

#endregion

namespace MammothMicro.SilverSocket.Shared
{
    /// <summary>
    /// Serialize and deserialize messages.
    /// </summary>
    public interface IMessageSerializer
    {
        /// <summary>
        /// Serialize message to byte array.
        /// </summary>
        /// <param name="message">
        /// Message to serialize
        /// </param>
        /// <returns>
        /// Serialized message.
        /// </returns>
        List<byte> Serialize(DuplexMessage message);

        /// <summary>
        /// Deserialize message from byte array.
        /// </summary>
        /// <param name="serializedMessage">
        /// Serialized message.
        /// </param>
        /// <returns>
        /// Deserialize message.
        /// </returns>
        DuplexMessage Deserialize(List<byte> serializedMessage);

        List<Type> KnownMessages { get; set; }
    }
}